<template>
  <div class="vehicle-box">
    <div class="myvan-image" v-for="item in listData" :key="item.id" @click="toDetails(item)">
      <van-image
        :src="item.imgSrc"
        rel="external nofollow"
        class="vehicle-img"
      />
      <!-- 品牌 -->
      <div class="vehicle-brand">
        <h5>{{item.name}}</h5>
        <span>{{item.cardType}}</span>
      </div>
      <!-- 介绍 -->
      <div class="vehicle-introduce">
        <span>{{item.gearType}}</span>
        <span>{{item.seatsNum}}</span>
        <span>{{item.engineModel}}</span>
      </div>
      <!-- 价格 -->
      <div class="price">
        <span>{{item.dailyPrice}}</span>
        <span>
          <van-icon name="arrow" />
        </span>
      </div>
      <!-- 商家 -->
      <div class="shopper">
        <span>{{item.company}}</span>
    </div>
  </div>
</div>
</template>
<script>
export default {
  name: "vehicleList",
  props: {
    listData: Array
  },
  data() {
    return {};
  },
  mounted() {
  },
  methods: {
    toDetails(e) {
      this.$router.push({
        path: '/details',
        query: e
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.vehicle-box {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
}
.myvan-image {
    width: 48%;
    height: 100%;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 0 10px rgb(180, 180, 180);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    background-color: #fff;
    &:last-of-type {
      margin-bottom: 50px;
    }
  }
  // 车辆
  .tab-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-flow: row wrap;
  }
  .myvan-image {
    padding: $height/4;
    box-sizing: border-box;
    // 图片
    .vehicle-img {
      width: 100%;
      height: 120px;
      background-color: #fff;
      text-align: center;
      padding: $height/2;
      box-sizing: border-box;
      img {
        width: 100%;
        height: 100%;
      }
    }
    // 品牌

    .vehicle-brand {
      width: 100%;
      height: $height/2;
      display: flex;
      justify-content: flex-start;
      h5 {
        transform: scale(0.8);
        font-size: 14px;
      }
      span {
        width: 36px;
        height: 20px;
        line-height: 20px;
        border-radius: 4px;
        background-color: $color;
        color: #fff;
        text-align: center;
        transform: scale(0.8);
        font-size: 8px;
      }
    }
    // 配置
    .vehicle-introduce {
      width: 100%;
      height: $height/2;
      line-height: $height/2;
      color: #666;
      // transform: scale(0.8);
      font-size: 8px;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      margin: 4px 0;
      span {
        &:nth-of-type(2):before, &:nth-of-type(3):before {
          content: '·';
          font-size: 20px;
          line-height: $height/2;
          margin: 0 2px;
        }
        &:nth-of-type(3)::after {
          content: 'L';
        }
      }
    }
    // 价格
    .price {
      width: 100%;
      display: flex;
      justify-content: space-between;
      margin: 8px 0;
      span {
        &:nth-of-type(1) {
          color: rgb(243, 22, 22);
          &:before, &:after {
            content: '￥';
            transform: scale(0.1);
            font-size: 8px;
          }
          &:after {
            content: '/天';
            color: #333;
          }
        }
      }
      span {
        &:nth-of-type(2) {
          width: 10px*2;
          height: 10px*2;
          line-height: 10px*3;
          border-radius: 50%;
          transform: scale(0.5);
          font-size: 16px;
          text-align: center;
          background-color: rgb(243, 22, 22);
          color: #fff;
        }
      }
    }
    // 店名
    .shopper {
      span {
        font-size: 10px;
        color: #666;
      }
    }
  }
</style>